package com.lpf.beans;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Table(name="table_user")
public class User {
	
	@Id
	private Integer userId;
	
	private String userName;

	//方法一 字段级别：@ColumnType 注解
	//@ColumnType(typeHandler=AddressTypeHandler.class)
	@Column
	private Address address;
	
	//在枚举类型这里无法使用@ColumnType注解注册MyBatis内置的枚举类型处理器
	//@ColumnType(typeHandler=EnumTypeHandler.class)
	@Column
	private SeasonEnum season;
	
	public User() {
		
	}

	public User(Integer userId, String userName, Address address, SeasonEnum season) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.address = address;
		this.season = season;
	}
}
